<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('自提点名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('联系人')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-contacts" data-rule="required" class="form-control" name="row[contacts]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('联系电话')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-phone" data-rule="required" class="form-control" name="row[phone]" type="text" value="">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('下单后可取时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-time" data-rule="required" class="form-control"  name="row[time]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('法人姓名')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-contact_name" data-rule="required" class="form-control" name="row[contact_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('身份证件号码')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-contact_id_number" data-rule="required" class="form-control" name="row[contact_id_number]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('证件正面照片')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-contact_id_doc_copy" data-rule="required" class="form-control" size="50" name="row[contact_id_doc_copy]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-contact_id_doc_copy" class="btn btn-danger faupload" data-input-id="c-contact_id_doc_copy" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-contact_id_doc_copy"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-contact_id_doc_copy" class="btn btn-primary fachoose" data-input-id="c-contact_id_doc_copy" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-contact_id_doc_copy"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-contact_id_doc_copy"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('证件反面照片')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-contact_id_doc_copy_back" data-rule="required" class="form-control" size="50" name="row[contact_id_doc_copy_back]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-contact_id_doc_copy_back" class="btn btn-danger faupload" data-input-id="c-contact_id_doc_copy_back" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-contact_id_doc_copy_back"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-contact_id_doc_copy_back" class="btn btn-primary fachoose" data-input-id="c-contact_id_doc_copy_back" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-contact_id_doc_copy_back"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-contact_id_doc_copy_back"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('证件有效期开始时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-contact_period_begin" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[contact_period_begin]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('证件有效期结束时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-contact_period_end" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[contact_period_end]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-12 col-sm-8 col-sm-offset-2">
            <label>
                <input type="checkbox" id="long-term-checkbox1"> 长期
            </label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('身份证居住地址法人')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-id_card_address" class="form-control" name="row[id_card_address]" type="text" value="{$row.id_card_address|htmlentities}">
        </div>
    </div>
    <!--        <div class="form-group">-->
    <!--            <label class="control-label col-xs-12 col-sm-2">{:__('Business_authorization_letter')}:</label>-->
    <!--            <div class="col-xs-12 col-sm-8">-->
    <!--                <input id="c-business_authorization_letter" class="form-control" name="row[business_authorization_letter]" type="text" value="{$row.business_authorization_letter|htmlentities}">-->
    <!--            </div>-->
    <!--        </div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('联系手机')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-mobile_phone" data-rule="required" class="form-control" name="row[mobile_phone]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('联系邮箱')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-contact_email" data-rule="required" class="form-control" name="row[contact_email]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('主体类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-subject_type" class="form-control" name="row[subject_type]" data-rule="required">
                <option value="" >请选择</option>
                <option value="SUBJECT_TYPE_INDIVIDUAL" >个体户、个体工商户、个体经营</option>
                <option value="SUBJECT_TYPE_ENTERPRISE">有限公司、有限责任公司</option>
                <option value="SUBJECT_TYPE_GOVERNMENT" >政府机关</option>
                <option value="SUBJECT_TYPE_INSTITUTIONS" >事业单位</option>
                <option value="SUBJECT_TYPE_OTHERS">社会团体、民办非企业、基金会、基层群众性自治组织、农村集体经济组织等</option>
            </select>
        </div>
        <!--            <div class="col-xs-12 col-sm-8">-->
        <!--                <input id="c-subject_type" class="form-control" name="row[subject_type]" type="text" value="{$row.subject_type|htmlentities}">-->
        <!--            </div>-->
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('所属行业')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-qualification_type" class="form-control" name="row[qualification_type]" data-rule="required">
                <option value="" >请选择</option>
                {volist name="industries" id="industry"}
                <option value="{$industry.industry_name}">{$industry.industry_name}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('营业执照照片')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-license_copy" data-rule="required" class="form-control" size="50" name="row[license_copy]" type="text" value="" >
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-license_copy" class="btn btn-danger faupload" data-input-id="c-license_copy" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-license_copy"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-license_copy" class="btn btn-primary fachoose" data-input-id="c-license_copy" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-license_copy"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-license_copy"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('注册号/统一社会信用代码')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-license_number" data-rule="required" class="form-control" name="row[license_number]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商户名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-merchant_name" data-rule="required" class="form-control" name="row[merchant_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('注册地址')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-license_address" data-rule="required" class="form-control" name="row[license_address]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('有效期限开始日期')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-license_period_begin" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[license_period_begin]" type="text" value="">
        </div>
    </div>
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('有效期限结束日期')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-license_period_end" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[license_period_end]" type="text" value="">-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('有效期限结束日期')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-license_period_end" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[license_period_end]" type="text" value="">
            <div class="checkbox">
                <label>
                    <input id="c-long-term" type="checkbox"> 长期
                </label>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('登记证书照片')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-cert_copy"  class="form-control" size="50" name="row[cert_copy]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-cert_copy" class="btn btn-danger faupload" data-input-id="c-cert_copy" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-cert_copy"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-cert_copy" class="btn btn-primary fachoose" data-input-id="c-cert_copy" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-cert_copy"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-cert_copy"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('登记证书类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-cert_type"  class="form-control" name="row[cert_type]">
                <option value="">请选择</option>
                <option value="CERTIFICATE_TYPE_2388" >事业单位法人证书</option>
                <option value="CERTIFICATE_TYPE_2389" >统一社会信用代码证书</option>
                <option value="CERTIFICATE_TYPE_2394" >社会团体法人登记证书</option>
                <option value="CERTIFICATE_TYPE_2395" >民办非企业单位登记证书</option>
                <option value="CERTIFICATE_TYPE_2396" >基金会法人登记证书</option>
                <option value="CERTIFICATE_TYPE_2520" >执业许可证/执业证</option>
                <option value="CERTIFICATE_TYPE_2521" >基层群众性自治组织特别法人统一社会信用代码证</option>
                <option value="CERTIFICATE_TYPE_2522" >农村集体经济组织登记证</option>
                <option value="CERTIFICATE_TYPE_2399" >宗教活动场所登记证</option>
                <option value="CERTIFICATE_TYPE_2400" >政府部门下发的其他有效证明文件</option>
            </select>
        </div>
        <!--            <div class="col-xs-12 col-sm-8">-->
        <!--                <input id="c-cert_type" class="form-control" name="row[cert_type]" type="text" value="{$row.cert_type|htmlentities}">-->
        <!--            </div>-->
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('证书号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-cert_number" class="form-control" name="row[cert_number]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('登记证书的注册地址')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-company_address" class="form-control" name="row[company_address]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('有效期限开始日期')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-certificate_period_begin" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[certificate_period_begin]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('有效期限结束日期')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-certificate_period_end" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[certificate_period_end]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-12 col-sm-8 col-sm-offset-2">
            <label>
                <input type="checkbox" id="long-term-checkbox2"> 长期
            </label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('账户类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-bank_account_type" data-rule="required" class="form-control" name="row[bank_account_type]">
                <option value="">请选择</option>
                <option value="BANK_ACCOUNT_TYPE_CORPORATE" >对公银行账户</option>
                <option value="BANK_ACCOUNT_TYPE_PERSONAL">经营者个人银行卡</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('银行账号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-account_number" data-rule="required" class="form-control" name="row[account_number]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('银行名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-account_bank" data-rule="required" class="form-control" name="row[account_bank]">
                <option value="">请选择</option>
                <option value="工商银行" >工商银行</option>
                <option value="交通银行" >交通银行</option>
                <option value="招商银行" >招商银行</option>
                <option value="民生银行" >民生银行</option>
                <option value="中信银行" >中信银行</option>
                <option value="浦发银行" >浦发银行</option>
                <option value="兴业银行" >兴业银行</option>
                <option value="光大银行" >光大银行</option>
                <option value="广发银行" >广发银行</option>
                <option value="平安银行" >平安银行</option>
                <option value="北京银行" >北京银行</option>
                <option value="华夏银行" >华夏银行</option>
                <option value="农业银行" >农业银行</option>
                <option value="建设银行" >建设银行</option>
                <option value="邮政储蓄银行" >邮政储蓄银行</option>
                <option value="中国银行" >中国银行</option>
                <option value="宁波银行" >宁波银行</option>
                <option value="其他银行" >其他银行</option>
            </select>
            <!--                <input id="c-account_bank" class="form-control" name="row[account_bank]" type="text" value="{$row.account_bank|htmlentities}">-->
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('开户银行省市编码')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-bank_address_code" data-rule="required" class="form-control" name="row[bank_address_code]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('开户银行联行号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-bank_branch_id"  class="form-control" name="row[bank_branch_id]" type="text" value="">
            "17家直连银行无需填写，如为其他银行，则开户银行全称（含支行）和 开户银行联行号二选一 2、需填写银行全称，如"深圳农村商业银行XXX支行"
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('开户银行全称（含支行）')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-bank_name" class="form-control" name="row[bank_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('自提点照片')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-img" class="form-control" size="50" name="row[img]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-img" class="btn btn-danger faupload" data-input-id="c-img" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-img"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-img" class="btn btn-primary fachoose" data-input-id="c-img" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-img"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-img"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('详细地址')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" data-rule="required" class="form-control " name="row[address]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-2 col-sm-2">{:__('纬度')}:</label>
        <div class="col-xs-2 col-sm-2">
            <input id="c-pointLat" data-rule="required"  class="form-control" name="row[pointLat]" type="text" value="">
        </div>
        <label class="control-label col-xs-2 col-sm-2">{:__('经度')}:</label>
        <div class="col-xs-2 col-sm-2">
            <input id="c-pointLng" data-rule="required"  class="form-control" name="row[pointLng]" type="text" value="">
        </div>
        <input type="button" data-toggle="addresspicker" data-input-id="c-address" data-lat-id="c-pointLat" data-lng-id="c-pointLng" value="选取详细地址" >
    </div>
    <div class="form-group">
        <label class="control-label col-xs-2 col-sm-2">{:__('预计几小时后送到')}:</label>
        <div class="col-xs-2 col-sm-2">
            <input id="c-cometime" data-rule="required"  class="form-control" name="row[cometime]" type="number" value="3">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
    document.getElementById('c-long-term').addEventListener('change', function() {
        var dateInput = document.getElementById('c-license_period_end');
        if (this.checked) {
            dateInput.value = '长期';
            dateInput.disabled = true; // 禁用输入框
        } else {
            dateInput.value = '';
            dateInput.disabled = false; // 启用输入框
        }
    });
    $(document).ready(function() {
        if ($('#c-contact_period_end').val() === '长期') {
            $('#long-term-checkbox1').prop('checked', true);
            $('#c-contact_period_end').prop('disabled', true);
        }
        $('#long-term-checkbox1').change(function() {
            if ($(this).is(':checked')) {
                $('#c-contact_period_end').val('长期').prop('disabled', true);
            } else {
                $('#c-contact_period_end').val('').prop('disabled', false);
            }
        });


        if ($('#long-term-checkbox1').is(':checked')) {
            $('#c-contact_period_end').val('长期').prop('disabled', true);
        }
        if ($('#c-certificate_period_end').val() === '长期') {
            $('#long-term-checkbox2').prop('checked', true);
            $('#c-certificate_period_end').prop('disabled', true);
        }

        $('#long-term-checkbox2').change(function() {
            if ($(this).is(':checked')) {
                $('#c-certificate_period_end').val('长期').prop('disabled', true);
            } else {
                $('#c-certificate_period_end').val('').prop('disabled', false);
            }
        });
        if ($('#long-term-checkbox2').is(':checked')) {
            $('#c-certificate_period_end').val('长期').prop('disabled', true);
        }
    });
</script>
